public class Date1 {
    public int year;
    public int month;
    public int day;

    public Date1(int year, int month, int day){
        this.year = year;
        this.month = month;
        this.day = day;
        System.out.println("Date(int,int,int)⽅法被调⽤了");
    }

    public void printDate(){
        System.out.println(year + "-" + month + "-" + day);
    }

    public static void main(String[] args) {
        // 此处创建了⼀个Date类型的对象，并没有显式调⽤构造⽅法
        Date1 d = new Date1(1999,6,9);   // 输出Date(int,int,int)⽅法被调⽤了
        d.printDate();    //1999-6-9
    }
}
